package com;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.DBManipulation;

/**
 * Servlet implementation class EditPaymentVoucherServlet
 */
public class EditPaymentVoucherServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public EditPaymentVoucherServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		try
		{
		PaymentVoucherBean pyBean=new PaymentVoucherBean();
		
		pyBean.setPaymentBankName(request.getParameter("pybankname"));
		pyBean.setPaymentEntryNumber(request.getParameter("pyentrynumber"));
		pyBean.setPaymentCheque(request.getParameter("pychecquenumber"));
		pyBean.setPaymentDate(request.getParameter("pydate"));
		pyBean.setPaymentAccount(request.getParameter("pyaccount"));
		pyBean.setPaymentAmount(Double.parseDouble(request.getParameter("pyamount")));
		pyBean.setPaymentAccount2(request.getParameter("pyaccount2"));
		//pyBean.setPaymentAmount2(Double.parseDouble(request.getParameter("pyamount2")));
		//pyBean.setPaymentNarration(request.getParameter("pynarration"));
		
		DBManipulation dbc= new DBManipulation();
		dbc.updatePaymentVoucher(pyBean);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
